package com.elink.enginerring.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.elink.enginerring.service.CategoryService;

@RestController

@RequestMapping("/api/category")
@Api(value = "论文图书馆分类接口")
public class CategoryController {
	@Autowired
	private CategoryService categoryService;

	/**
	 * 获取论文图书馆一级分类接口
	 * @return
	 */
	@RequestMapping(value = "/getTopCategory", method = RequestMethod.GET)
	@ApiOperation(value = "获取论文图书馆一级分类接口")
	public Map<String, Object> getTopCategory() {
		return categoryService.getTopCategory();
	}
	
	/**
	 * 获取论文图书馆二级分类接口
	 * @param tcId
	 * @return
	 */
	@RequestMapping(value = "/getSecondaryCategory", method = RequestMethod.GET)
	@ApiOperation(value = "获取论文图书馆二级分类接口")
	public Map<String, Object> getSecondaryCategory(@ApiParam(value = "一级分类 tcId", required = true) @RequestParam("tcId") int tcId) {
		return categoryService.getSecondaryCategory(tcId);
	}
	
	/**
	 * 获取论文图书馆三级分类接口
	 * @param scId
	 * @returnb 
	 */
	@RequestMapping(value = "/getDetailCategory", method = RequestMethod.GET)
	@ApiOperation(value = "获取论文图书馆三级分类接口")
	public Map<String, Object> getDetailCategory(@ApiParam(value = "二级分类 scId", required = true) @RequestParam("scId") int scId) {
		return categoryService.getDetailCategory(scId);
	}
}
